<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'upload.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="${pageContext.request.contextPath}/admin/css/dropzone.css" type="text/css" rel="stylesheet" />  
	<script type="text/javascript" src="${pageContext.request.contextPath}/admin/js/dropzone.js"></script>
  </head>
  <body>
    <form action="" method = "post">
    	用户名:<input type="text" name = "userName"> <br>
    	头&nbsp;&nbsp;像:
    	<div id = "img" class = "dropzone"></div>
    	<input type = "button" value = "添加附件" onclick="dropz.processQueue()" />
    	<input type = "submit" value = "提交">
    </form>
    
    <script type="text/javascript">
    	var dropz = new Dropzone("#img",{
    		url: "${pageContext.request.contextPath}/file/fileUpload.do",
    		addRemoveLinks:true,
    		autoProcessQueue:false,
    		paralleUploads:1,
    		maxFiles:1,
    		init: function(){
    			this.on("removedfile",function(file){
    				console.log("File " +file.name + "removed");
    			});
    		},
    	
    	});
    </script>
  </body>
</html>
